-- copy from neovim-session-manager
-- check nvim version
if not vim.fn.has('nvim-0.7.0') then
  return
end

local M = {}

-- set autocmd
local function set_autocmd()
  local session_manager_group = vim.api.nvim_create_augroup('SessionManager', {})
  -- auto load session
  vim.api.nvim_create_autocmd({ 'VimEnter' }, {
    group = session_manager_group,
    nested = true,
    callback = function ()
      -- todo
    end,
  })
  -- auto save session
  vim.api.nvim_create_autocmd({ 'VimLeavePre' }, {
    group = session_manager_group,
    callback = function ()
      -- todo
    end,
  })

  vim.api.nvim_create_autocmd({ 'StdinReadPre' }, {
    group = session_manager_group,
    callback = function() vim.g.started_with_stdin = true end,
  })
end

function M.setup(config)
  set_autocmd()
  print(config)
end

return M
